<?php //echo $this->Html->script("tiny_mce/tiny_mce"); ?>
  <?php echo $this->Form->create('TicketMessage', array('url' => array('controller' => 'tickets', 'action' => 'reply'), 'class' => 'form', 'type' => 'file')); ?>
      <?php echo $this->Form->input('TicketMessage.ticket_id', array('type' => 'hidden')); ?>
      <?php echo $this->Form->input('TicketMessage.from', array('type' => 'hidden', 'value' => 'Admin')); ?>
      <?php echo $this->Form->input('TicketMessage.name', array('type' => 'hidden')); ?>
  		<table border="0" cellpadding="0" cellspacing="0"  id="id-form">
      		<tr>
      			<th valign="top">Ticket ID:</th>
      			<td>
                <?php echo $this->Form->input('Ticket.key', array('label' => false, 'div' => false, 'readonly' => true)); ?>      
            </td>
      			<td></td>
      		</tr>
      		<tr>
      			<th valign="top">Subject:</th>
      			<td>
                <?php echo $this->Form->input('TicketMessage.subject', array('label' => false, 'div' => false, 'class' => 'input-form', 'style' => 'width:500px;')); ?>      
            </td>
      			<td></td>
      		</tr>

      		<tr>
      			<th valign="top">Attachment:</th>
      			<td>
                <?php echo $this->Form->input("attachment", array('label' => false, 'div' => false, 'type' => 'file', 'class' => 'file_1 med')); ?>  
            </td>
      			<td></td>
      		</tr>
          		<tr>
          			<th valign="top">Content:</th>
          			<td>

<script type="text/javascript">
// O2k7 skin
tinyMCE.init({
        // General options
        mode : "exact",
        elements : "reply_description",
        theme : "advanced",
        skin : "o2k7",
        width : "1000",
        plugins : "safari,spellchecker,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",

        // Theme options
        theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",
        theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
        theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
        theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,spellchecker,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,blockquote,pagebreak,|,insertfile,insertimage",
        theme_advanced_toolbar_location : "top",
        theme_advanced_toolbar_align : "left",
        theme_advanced_statusbar_location : "bottom",
        theme_advanced_resizing : true,

        // Example content CSS (should be your site CSS)
        content_css : "css/admin/screen.css",

        // Drop lists for link/image/media/template dialogs
        template_external_list_url : "js/tiny_mce/plugins/template/editor_plugin.js",
        external_link_list_url : "js/link_list.js",
        external_image_list_url : "js/image_list.js",
        media_external_list_url : "js/tiny_mce/plugins/media/editor_plugin.js",

        // Replace values for the template plugin
        template_replace_values : {
                username : "Some User",
                staffid : "991234"
        }
});
</script>
                    <?php echo $this->Form->input('content', array('label' => false, 'div' => false, 'id' =>'reply_description', 'class' => 'required form-textarea')); ?>      
                </td>
          			<td></td>
          		</tr>
            	<tr>
            		<th>&nbsp;</th>
            		<td valign="top">
                    <?php echo $this->Form->submit('Send', array('label' => false, 'div' => false, 'class' => 'submit-button')); ?>
     			           <?php 
                        if(isset($flag) && $flag == 0){
                     ?>
                         <span class="cancel-button cancelMail">Cancel</span>
                     <?php   
                        }else{
                     ?>
                         <span class="cancel-button cancelReply">Cancel</span>
                     <?php   
                        }
                     ?>
             		</td>
            		<td></td>
            	</tr>
         </table>
  <?php echo $this->Form->end(); ?>


